//
//  ARTNetworkEngine.h
//  ChartsDemo
//
//  Created by yunda on 2021/10/14.
//

#import <Foundation/Foundation.h>
#import "ARTRequestModel.h"
#import "ARTResponseModel.h"

NS_ASSUME_NONNULL_BEGIN

/// request success
typedef void (^RequestSuccessdCallback)(ARTResponseModel * _Nonnull responseModel);
/// request error
typedef void (^RequestFailedCallback)(NSError * _Nullable error);
/// request progress
typedef void (^RequestProgressCallback)(CGFloat value);

/// http响应成功
typedef void(^ ResponseSuccess)(id _Nullable json);
/// http响应失败
typedef void(^ ResponseFailure)(NSString * _Nonnull errorMSG);

@interface ARTNetworkEngine : NSObject

/// 单利
#define ARTNetwork [ARTNetworkEngine defaultManager]
+ (ARTNetworkEngine *)defaultManager;

/// 网络请求
- (void)requestWithDataModel:(ARTRequestModel * _Nonnull)dataModel progressCallback:(RequestProgressCallback _Nullable)progressBlock successdCallback:(RequestSuccessdCallback _Nullable)succeedBlock failedCallback:(RequestFailedCallback _Nullable)failedBlock;

@end

NS_ASSUME_NONNULL_END
